package remin;


import java.util.Calendar;

public class OutDate {
	
	Integer yy,mm,dd,hh,mi;
	Integer y2,m2,d2,h2,mi2;
	public static String mytime;
	boolean bol;
	
	
	public boolean isOutOfDate(String mydat){
	
		//string v tvare "hh:mi dd.mm.yy"
		Calendar now = Calendar.getInstance();
		 int hh = now.get(Calendar.HOUR_OF_DAY);
		 int mi = now.get(Calendar.MINUTE);
		 int mm = now.get(Calendar.MONTH) + 1;
		 int dd = now.get(Calendar.DAY_OF_MONTH);
		int yy = now.get(Calendar.YEAR);
		
		h2 =Integer.parseInt(mydat.substring(0,2));
		mi2 = Integer.parseInt(mydat.substring(3, 5));
		d2 = Integer.parseInt(mydat.substring(6, 8));
		m2 = Integer.parseInt(mydat.substring(9, 11));
		y2 = Integer.parseInt(mydat.substring(12,16));
		
		mytime =  h2+":"+mi2+" "+d2+"."+m2+"."+y2;
		//System.out.println(mytime);
		
		if(y2-yy>0) {bol = false;}
		else if(y2-yy<0) {bol = true;}
		else {
			if(m2-mm>0) {bol = false;}
			else if(m2-mm<0) {bol = true;}
			else{
				if(d2-dd>0) {bol = false;}
				else if(d2-dd<0) {bol = true;}
				else{
					if(h2-hh>0) {bol = false;}
					else if(h2-hh<0) {bol = true;}
					else{
						if(mi2-mi>=0){bol = false;}
						else{bol = true;}
					}
				}
			}
		}
		
		return bol;
	}
}